package com.xiaoye.qbproject.controller.db2;

import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.xiaoye.qbproject.domain.AjaxResult;
import com.xiaoye.qbproject.domain.SysRole;
import com.xiaoye.qbproject.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class SysRoleController {
    @Autowired
    private SysRoleService sysRoleService;

    @GetMapping("/list")
    public AjaxResult list() {
        // 执行数据库操作
        List<SysRole> list = sysRoleService.getList();
        return AjaxResult.success(list);
    }
}
